//---------------------------------------------------------------------------

#ifndef ParameterH
#define ParameterH
#include <IniFiles.hpp>
#include "Business.h"
#include "Param.h"
class Controller;
//---------------------------------------------------------------------------
class Tparameter:public CBusiness
{
   public:
      static Tparameter* GetInstance();
      //static free();
      virtual ~Tparameter();
      UINT8 Check_Sum(UINT8* buf,int len);
      bool isValid(UINT8* buf,int len);
      void EnableSaveParam(bool flag);
      void CreateIniFile(AnsiString fileName);
      virtual int  PraseFrame(TCommunication* comm,UINT8* packetBuf, UINT32 len);
   private:
      Tparameter();
      virtual void Disposal(TCommunication* comm,UINT8* packetBuf, UINT32 len);
      void WriteIntParam(AnsiString secName,AnsiString paramName,INT32 Param,UINT8 type);
      void WriteFloatParam(AnsiString secName,AnsiString paramName,float Param);
      static Tparameter* m_ParamObj;
      Tparameter* ParamObj;
      TIniFile* fp;
      bool EnableSaveParamFlag;

};
#endif
